package com.kongzue.baseokhttpv3.slice;


import com.kongzue.baseokhttpv3.ResourceTable;
import ohos.agp.components.Component;
import ohos.agp.components.LayoutScatter;
import ohos.agp.utils.LayoutAlignment;
import ohos.agp.window.dialog.CommonDialog;
import ohos.app.Context;


public class LoadDialog extends CommonDialog {
    private Context context;

    public LoadDialog(Context context)
    {
        super(context);
        this.context = context;
        setAlignment(LayoutAlignment.CENTER);
    }

    @Override
    protected void onCreate()
    {
        super.onCreate();
        Component layout = LayoutScatter.getInstance(context).parse(
            ResourceTable.Layout_dialog_load_layout, null, true);
        ProgressWheel progressWheel = (ProgressWheel) layout.findComponentById(ResourceTable.Id_progress_wheel);
        progressWheel.startSpinning();

        setTransparent(true);
        setContentCustomComponent(layout);
    }
}
